#!/usr/bin/env ruby

$:.unshift File.join(File.dirname(__FILE__),'..','lib')

require 'roadrunner'

dl=RoadRunner.new

=begin
  RoadRunner::mode =>
  /thread/,/t/
  /process/,/p/
  else.
  Defined in run.rb
  当mode为进程的时候,RoadRunner将产生最真实的压力
=end

dl.mode='p'

dl.init do
  # users决定同时有多少并发用户一起执行action
  # iterations决定每个用户执行多少次
  dl.users,dl.iterations=5,10
end


dl.action do
  sleep 10
  %x{wget "http://dl_dir.qq.com/qqfile/qq/QQforMac/QQ_B1_606.dmg" 1>/dev/null 2>&1}
end

dl.ended do
end

dl.run
dl.report

p "Tps could get : RoadRunner::tps => #{dl.tps}"
